<?php


abstract class BaseStage extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $id;


	
	protected $etudiant_id;


	
	protected $societe_id;


	
	protected $poste;


	
	protected $tag;


	
	protected $created_at;


	
	protected $debut;


	
	protected $fin;


	
	protected $remuneration;


	
	protected $poursuite_stage;


	
	protected $adresse;


	
	protected $code_postal;


	
	protected $ville;


	
	protected $pays;


	
	protected $geolocalisation;


	
	protected $recommander;


	
	protected $appreciation;


	
	protected $email_tuteur;


	
	protected $niveau_imac;

	
	protected $aEtudiant;

	
	protected $aSociete;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getId()
	{

		return $this->id;
	}

	
	public function getEtudiantId()
	{

		return $this->etudiant_id;
	}

	
	public function getSocieteId()
	{

		return $this->societe_id;
	}

	
	public function getPoste()
	{

		return $this->poste;
	}

	
	public function getTag()
	{

		return $this->tag;
	}

	
	public function getCreatedAt($format = 'Y-m-d H:i:s')
	{

		if ($this->created_at === null || $this->created_at === '') {
			return null;
		} elseif (!is_int($this->created_at)) {
						$ts = strtotime($this->created_at);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true));
			}
		} else {
			$ts = $this->created_at;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getDebut($format = 'Y-m-d')
	{

		if ($this->debut === null || $this->debut === '') {
			return null;
		} elseif (!is_int($this->debut)) {
						$ts = strtotime($this->debut);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [debut] as date/time value: " . var_export($this->debut, true));
			}
		} else {
			$ts = $this->debut;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getFin($format = 'Y-m-d')
	{

		if ($this->fin === null || $this->fin === '') {
			return null;
		} elseif (!is_int($this->fin)) {
						$ts = strtotime($this->fin);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [fin] as date/time value: " . var_export($this->fin, true));
			}
		} else {
			$ts = $this->fin;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getRemuneration()
	{

		return $this->remuneration;
	}

	
	public function getPoursuiteStage()
	{

		return $this->poursuite_stage;
	}

	
	public function getAdresse()
	{

		return $this->adresse;
	}

	
	public function getCodePostal()
	{

		return $this->code_postal;
	}

	
	public function getVille()
	{

		return $this->ville;
	}

	
	public function getPays()
	{

		return $this->pays;
	}

	
	public function getGeolocalisation()
	{

		return $this->geolocalisation;
	}

	
	public function getRecommander()
	{

		return $this->recommander;
	}

	
	public function getAppreciation()
	{

		return $this->appreciation;
	}

	
	public function getEmailTuteur()
	{

		return $this->email_tuteur;
	}

	
	public function getNiveauImac()
	{

		return $this->niveau_imac;
	}

	
	public function setId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = StagePeer::ID;
		}

	} 
	
	public function setEtudiantId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->etudiant_id !== $v) {
			$this->etudiant_id = $v;
			$this->modifiedColumns[] = StagePeer::ETUDIANT_ID;
		}

		if ($this->aEtudiant !== null && $this->aEtudiant->getId() !== $v) {
			$this->aEtudiant = null;
		}

	} 
	
	public function setSocieteId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->societe_id !== $v) {
			$this->societe_id = $v;
			$this->modifiedColumns[] = StagePeer::SOCIETE_ID;
		}

		if ($this->aSociete !== null && $this->aSociete->getId() !== $v) {
			$this->aSociete = null;
		}

	} 
	
	public function setPoste($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->poste !== $v) {
			$this->poste = $v;
			$this->modifiedColumns[] = StagePeer::POSTE;
		}

	} 
	
	public function setTag($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->tag !== $v) {
			$this->tag = $v;
			$this->modifiedColumns[] = StagePeer::TAG;
		}

	} 
	
	public function setCreatedAt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [created_at] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->created_at !== $ts) {
			$this->created_at = $ts;
			$this->modifiedColumns[] = StagePeer::CREATED_AT;
		}

	} 
	
	public function setDebut($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [debut] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->debut !== $ts) {
			$this->debut = $ts;
			$this->modifiedColumns[] = StagePeer::DEBUT;
		}

	} 
	
	public function setFin($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [fin] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->fin !== $ts) {
			$this->fin = $ts;
			$this->modifiedColumns[] = StagePeer::FIN;
		}

	} 
	
	public function setRemuneration($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->remuneration !== $v) {
			$this->remuneration = $v;
			$this->modifiedColumns[] = StagePeer::REMUNERATION;
		}

	} 
	
	public function setPoursuiteStage($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->poursuite_stage !== $v) {
			$this->poursuite_stage = $v;
			$this->modifiedColumns[] = StagePeer::POURSUITE_STAGE;
		}

	} 
	
	public function setAdresse($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->adresse !== $v) {
			$this->adresse = $v;
			$this->modifiedColumns[] = StagePeer::ADRESSE;
		}

	} 
	
	public function setCodePostal($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->code_postal !== $v) {
			$this->code_postal = $v;
			$this->modifiedColumns[] = StagePeer::CODE_POSTAL;
		}

	} 
	
	public function setVille($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->ville !== $v) {
			$this->ville = $v;
			$this->modifiedColumns[] = StagePeer::VILLE;
		}

	} 
	
	public function setPays($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->pays !== $v) {
			$this->pays = $v;
			$this->modifiedColumns[] = StagePeer::PAYS;
		}

	} 
	
	public function setGeolocalisation($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->geolocalisation !== $v) {
			$this->geolocalisation = $v;
			$this->modifiedColumns[] = StagePeer::GEOLOCALISATION;
		}

	} 
	
	public function setRecommander($v)
	{

		if ($this->recommander !== $v) {
			$this->recommander = $v;
			$this->modifiedColumns[] = StagePeer::RECOMMANDER;
		}

	} 
	
	public function setAppreciation($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->appreciation !== $v) {
			$this->appreciation = $v;
			$this->modifiedColumns[] = StagePeer::APPRECIATION;
		}

	} 
	
	public function setEmailTuteur($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->email_tuteur !== $v) {
			$this->email_tuteur = $v;
			$this->modifiedColumns[] = StagePeer::EMAIL_TUTEUR;
		}

	} 
	
	public function setNiveauImac($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->niveau_imac !== $v) {
			$this->niveau_imac = $v;
			$this->modifiedColumns[] = StagePeer::NIVEAU_IMAC;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->etudiant_id = $rs->getInt($startcol + 1);

			$this->societe_id = $rs->getInt($startcol + 2);

			$this->poste = $rs->getString($startcol + 3);

			$this->tag = $rs->getString($startcol + 4);

			$this->created_at = $rs->getTimestamp($startcol + 5, null);

			$this->debut = $rs->getDate($startcol + 6, null);

			$this->fin = $rs->getDate($startcol + 7, null);

			$this->remuneration = $rs->getInt($startcol + 8);

			$this->poursuite_stage = $rs->getString($startcol + 9);

			$this->adresse = $rs->getString($startcol + 10);

			$this->code_postal = $rs->getString($startcol + 11);

			$this->ville = $rs->getString($startcol + 12);

			$this->pays = $rs->getString($startcol + 13);

			$this->geolocalisation = $rs->getString($startcol + 14);

			$this->recommander = $rs->getBoolean($startcol + 15);

			$this->appreciation = $rs->getString($startcol + 16);

			$this->email_tuteur = $rs->getString($startcol + 17);

			$this->niveau_imac = $rs->getString($startcol + 18);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 19; 
		} catch (Exception $e) {
			throw new PropelException("Error populating Stage object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(StagePeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			StagePeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
    if ($this->isNew() && !$this->isColumnModified(StagePeer::CREATED_AT))
    {
      $this->setCreatedAt(time());
    }

		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(StagePeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


												
			if ($this->aEtudiant !== null) {
				if ($this->aEtudiant->isModified()) {
					$affectedRows += $this->aEtudiant->save($con);
				}
				$this->setEtudiant($this->aEtudiant);
			}

			if ($this->aSociete !== null) {
				if ($this->aSociete->isModified()) {
					$affectedRows += $this->aSociete->save($con);
				}
				$this->setSociete($this->aSociete);
			}


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = StagePeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += StagePeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->aEtudiant !== null) {
				if (!$this->aEtudiant->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aEtudiant->getValidationFailures());
				}
			}

			if ($this->aSociete !== null) {
				if (!$this->aSociete->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aSociete->getValidationFailures());
				}
			}


			if (($retval = StagePeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}



			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = StagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getEtudiantId();
				break;
			case 2:
				return $this->getSocieteId();
				break;
			case 3:
				return $this->getPoste();
				break;
			case 4:
				return $this->getTag();
				break;
			case 5:
				return $this->getCreatedAt();
				break;
			case 6:
				return $this->getDebut();
				break;
			case 7:
				return $this->getFin();
				break;
			case 8:
				return $this->getRemuneration();
				break;
			case 9:
				return $this->getPoursuiteStage();
				break;
			case 10:
				return $this->getAdresse();
				break;
			case 11:
				return $this->getCodePostal();
				break;
			case 12:
				return $this->getVille();
				break;
			case 13:
				return $this->getPays();
				break;
			case 14:
				return $this->getGeolocalisation();
				break;
			case 15:
				return $this->getRecommander();
				break;
			case 16:
				return $this->getAppreciation();
				break;
			case 17:
				return $this->getEmailTuteur();
				break;
			case 18:
				return $this->getNiveauImac();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = StagePeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getEtudiantId(),
			$keys[2] => $this->getSocieteId(),
			$keys[3] => $this->getPoste(),
			$keys[4] => $this->getTag(),
			$keys[5] => $this->getCreatedAt(),
			$keys[6] => $this->getDebut(),
			$keys[7] => $this->getFin(),
			$keys[8] => $this->getRemuneration(),
			$keys[9] => $this->getPoursuiteStage(),
			$keys[10] => $this->getAdresse(),
			$keys[11] => $this->getCodePostal(),
			$keys[12] => $this->getVille(),
			$keys[13] => $this->getPays(),
			$keys[14] => $this->getGeolocalisation(),
			$keys[15] => $this->getRecommander(),
			$keys[16] => $this->getAppreciation(),
			$keys[17] => $this->getEmailTuteur(),
			$keys[18] => $this->getNiveauImac(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = StagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setEtudiantId($value);
				break;
			case 2:
				$this->setSocieteId($value);
				break;
			case 3:
				$this->setPoste($value);
				break;
			case 4:
				$this->setTag($value);
				break;
			case 5:
				$this->setCreatedAt($value);
				break;
			case 6:
				$this->setDebut($value);
				break;
			case 7:
				$this->setFin($value);
				break;
			case 8:
				$this->setRemuneration($value);
				break;
			case 9:
				$this->setPoursuiteStage($value);
				break;
			case 10:
				$this->setAdresse($value);
				break;
			case 11:
				$this->setCodePostal($value);
				break;
			case 12:
				$this->setVille($value);
				break;
			case 13:
				$this->setPays($value);
				break;
			case 14:
				$this->setGeolocalisation($value);
				break;
			case 15:
				$this->setRecommander($value);
				break;
			case 16:
				$this->setAppreciation($value);
				break;
			case 17:
				$this->setEmailTuteur($value);
				break;
			case 18:
				$this->setNiveauImac($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = StagePeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setEtudiantId($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setSocieteId($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setPoste($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setTag($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setDebut($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setFin($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setRemuneration($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setPoursuiteStage($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setAdresse($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setCodePostal($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setVille($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setPays($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setGeolocalisation($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setRecommander($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setAppreciation($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setEmailTuteur($arr[$keys[17]]);
		if (array_key_exists($keys[18], $arr)) $this->setNiveauImac($arr[$keys[18]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(StagePeer::DATABASE_NAME);

		if ($this->isColumnModified(StagePeer::ID)) $criteria->add(StagePeer::ID, $this->id);
		if ($this->isColumnModified(StagePeer::ETUDIANT_ID)) $criteria->add(StagePeer::ETUDIANT_ID, $this->etudiant_id);
		if ($this->isColumnModified(StagePeer::SOCIETE_ID)) $criteria->add(StagePeer::SOCIETE_ID, $this->societe_id);
		if ($this->isColumnModified(StagePeer::POSTE)) $criteria->add(StagePeer::POSTE, $this->poste);
		if ($this->isColumnModified(StagePeer::TAG)) $criteria->add(StagePeer::TAG, $this->tag);
		if ($this->isColumnModified(StagePeer::CREATED_AT)) $criteria->add(StagePeer::CREATED_AT, $this->created_at);
		if ($this->isColumnModified(StagePeer::DEBUT)) $criteria->add(StagePeer::DEBUT, $this->debut);
		if ($this->isColumnModified(StagePeer::FIN)) $criteria->add(StagePeer::FIN, $this->fin);
		if ($this->isColumnModified(StagePeer::REMUNERATION)) $criteria->add(StagePeer::REMUNERATION, $this->remuneration);
		if ($this->isColumnModified(StagePeer::POURSUITE_STAGE)) $criteria->add(StagePeer::POURSUITE_STAGE, $this->poursuite_stage);
		if ($this->isColumnModified(StagePeer::ADRESSE)) $criteria->add(StagePeer::ADRESSE, $this->adresse);
		if ($this->isColumnModified(StagePeer::CODE_POSTAL)) $criteria->add(StagePeer::CODE_POSTAL, $this->code_postal);
		if ($this->isColumnModified(StagePeer::VILLE)) $criteria->add(StagePeer::VILLE, $this->ville);
		if ($this->isColumnModified(StagePeer::PAYS)) $criteria->add(StagePeer::PAYS, $this->pays);
		if ($this->isColumnModified(StagePeer::GEOLOCALISATION)) $criteria->add(StagePeer::GEOLOCALISATION, $this->geolocalisation);
		if ($this->isColumnModified(StagePeer::RECOMMANDER)) $criteria->add(StagePeer::RECOMMANDER, $this->recommander);
		if ($this->isColumnModified(StagePeer::APPRECIATION)) $criteria->add(StagePeer::APPRECIATION, $this->appreciation);
		if ($this->isColumnModified(StagePeer::EMAIL_TUTEUR)) $criteria->add(StagePeer::EMAIL_TUTEUR, $this->email_tuteur);
		if ($this->isColumnModified(StagePeer::NIVEAU_IMAC)) $criteria->add(StagePeer::NIVEAU_IMAC, $this->niveau_imac);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(StagePeer::DATABASE_NAME);

		$criteria->add(StagePeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setEtudiantId($this->etudiant_id);

		$copyObj->setSocieteId($this->societe_id);

		$copyObj->setPoste($this->poste);

		$copyObj->setTag($this->tag);

		$copyObj->setCreatedAt($this->created_at);

		$copyObj->setDebut($this->debut);

		$copyObj->setFin($this->fin);

		$copyObj->setRemuneration($this->remuneration);

		$copyObj->setPoursuiteStage($this->poursuite_stage);

		$copyObj->setAdresse($this->adresse);

		$copyObj->setCodePostal($this->code_postal);

		$copyObj->setVille($this->ville);

		$copyObj->setPays($this->pays);

		$copyObj->setGeolocalisation($this->geolocalisation);

		$copyObj->setRecommander($this->recommander);

		$copyObj->setAppreciation($this->appreciation);

		$copyObj->setEmailTuteur($this->email_tuteur);

		$copyObj->setNiveauImac($this->niveau_imac);


		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new StagePeer();
		}
		return self::$peer;
	}

	
	public function setEtudiant($v)
	{


		if ($v === null) {
			$this->setEtudiantId(NULL);
		} else {
			$this->setEtudiantId($v->getId());
		}


		$this->aEtudiant = $v;
	}


	
	public function getEtudiant($con = null)
	{
				include_once 'lib/model/om/BaseEtudiantPeer.php';

		if ($this->aEtudiant === null && ($this->etudiant_id !== null)) {

			$this->aEtudiant = EtudiantPeer::retrieveByPK($this->etudiant_id, $con);

			
		}
		return $this->aEtudiant;
	}

	
	public function setSociete($v)
	{


		if ($v === null) {
			$this->setSocieteId(NULL);
		} else {
			$this->setSocieteId($v->getId());
		}


		$this->aSociete = $v;
	}


	
	public function getSociete($con = null)
	{
				include_once 'lib/model/om/BaseSocietePeer.php';

		if ($this->aSociete === null && ($this->societe_id !== null)) {

			$this->aSociete = SocietePeer::retrieveByPK($this->societe_id, $con);

			
		}
		return $this->aSociete;
	}

} 